package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/*
 * 套餐和菜品关联的mapper
 * mapper层的作用：
 *  执行对应的sql语句查询数据库里的数据
 * */
@Mapper
public interface SetmalDishMapper {

    /**
     * 根据菜品的ID批量删除菜品所属的套餐数据
     *
     * @param ids
     * @return List<Long> id
     * @info
     */
    @Select("select * from setmeal_dish where dish_id in (${ids})")
    public List<Long> selectSetmealIdList(String ids);

    /**
     * 根据套餐id查询套餐和菜品的关联关系
     *
     * @param setmealId
     * @return
     */
    @Select("select * from setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> getBySetmealId(Long setmealId);
}
